<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>百度网盘文件永久外链</title>
  <link  href="http://libs.baidu.com/bootstrap/2.0.4/css/bootstrap.min.css" type="text/css" rel="stylesheet" media="screen" />
  <style type="text/css">
            body {
                padding-top: 40px;
                padding-bottom: 40px;
                background-color: #f5f5f5;
            }
            .form_pan {
                max-width: 650px;
                padding: 19px 29px 29px;
                margin: 0 auto 20px;
                background-color: #fff;
                border: 1px solid #e5e5e5;
                -webkit-border-radius: 5px;
                -moz-border-radius: 5px;
                border-radius: 5px;
                -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
            }
            .form_pan .form_pan-heading {
                margin-bottom: 10px;
            }
  </style> 
</head>

<script type="text/javascript">
        function Change()
        {    
                    var host = window.location.host;    
                    var url = document.getElementById("text1").value;
                    var arr = url.split("&");
                    var shareid = arr[0].split("=")[1];
                    var uk = arr[1].split("=")[1];
                var file_value = "";
                    var file_type = document.getElementsByName("file_type");
                    for (var i = 0; i < file_type.length; i++) {
                    if (file_type[i].checked) {
                        file_value = file_type[i].value;
                        break;
                    }
                };
        var file_other = document.getElementById("file_other");
            file_other_text = document.getElementById("file_other_text");
        if (file_value == 'other') {
                    if (file_other_text.value.length == 0) {
                        alert("扩展名不能为空！");
                        inputUrl.focus();
                        return false;
                         }
                        //outputUrl.value = hostname + abc + "." + file_other_text.value;
                        var songurl = "http://"+host+"/bdpan.php/"+shareid+"/"+uk + "."+file_other_text.value;
                        document.getElementById("text2").value = songurl;
                            } else {
                                    //outputUrl.value = hostname + abc + "." + file_value;
                                var songurl = "http://"+host+"/bdpan.php/"+shareid+"/"+uk+"." + file_value;
                                document.getElementById("text2").value = songurl;
                     }

            //var songurl = "http://linuxlib.org/baidupan.php/"+shareid+"/"+uk+".mp3";
            //document.getElementById("text2").value = songurl;
        }
        function fileOtherTextChange() {
                if (file_other.checked == true) {
                    file_other_text.disabled = false;
                    file_other_text.focus();
                } else {
                    file_other_text.disabled = true;
                }
            }
</script>

<body>
     <div class='container'>
            <form class="form_pan" id="pan_form">
                <h2 class="form_pan-heading">百度网盘文件永久外链</h2><p>

                    分享地址：<input id="text1" type="TEXT" value="" style="width:550px;" size=""/><br />
                    外链地址：<input id="text2" type="TEXT" value="" style="width:550px;" size=""/><br />
        <p>
                    文件的扩展名：
                    <input type="radio" class="radio" name="file_type" id="file_mp3" value="mp3" onchange="fileOtherTextChange()" checked />
                    mp3
                    <input type="radio" class="radio" name="file_type" id="file_png" value="png" onchange="fileOtherTextChange()" />
                    png
                    <input type="radio" class="radio" name="file_type" id="file_exe" value="exe" onchange="fileOtherTextChange()" />
                    exe
                    <input type="radio" class="radio" name="file_type" id="file_zip" value="zip" onchange="fileOtherTextChange()" />
                    zip
                    <input type="radio" class="radio" name="file_type" id="file_mp4" value="mp4" onchange="fileOtherTextChange()" />
                    mp4
                    <input type="radio" class="radio" name="file_type" id="file_other" value="other" onchange="fileOtherTextChange()" />
                    其他格式
                    <input type="text" class="input-medium search-query" style="width:80px;" id="file_other_text" disabled />
                </p>
            <input type="BUTTON" value="转换" onclick="Change()"/>
      </div>
</body>
</html>